<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>定位位置</title>
    <style>
        body, div {
            margin: 0;
            padding: 0;
        }
        #wrap {
            position: relative;
            border: 20px solid red;
            padding: 40px;
            width: 60px;
            height: 60px;
        }
        #box {
            position: absolute;
            border: 10px solid black;
            margin: 30px;
            width: 50px;
            height: 50px;
            left: 0;
            top: 0;
        }
    </style>
</head>
<body>
    <div id="wrap">
        <div id="box"></div>
    </div>
</body>
</html>